﻿@model SnongPhoneShop.Models.SnongPhoneShopEntities
@{
    ViewBag.Title = "QLDanhMuc";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
}

<script type="text/javascript">
    function Check(value) {
        $.post("/Admin/DMSPCheckItem", { "ID": value }, function (data) { });
        return false;
    }

</script>

<div class="Chucnang">

    <ul>
        <li>
            <h2>
                <b>Quản lí danh mục</b></h2>
        </li>
        <li>
            <h2>
                <a href="@Url.Action("DMSPUnPublishMulti")"> 
                    <img src="~/Images/Icon/unpublish.png" />
                </a>
            </h2>
        </li>
        <li>
            <h2>
                <a href="@Url.Action("DMSPPublishMulti")">
                    <img src="~/Images/Icon/publish.png" />
                </a>
            </h2>
        </li>
        <li>
            <h2>
                <a href="@Url.Action("ThemDM")">
                    <img src="~/Images/Icon/add.png" /></a>
            </h2>
        </li>
        <li>
            <h2><a href="@Url.Action("DMSPDeleteMulti")">
                <img src="~/Images/Icon/delete.png" /></a></h2>
        </li>
    </ul>
</div>

<table border="1">
    <tr>
        <td>Check</td>
        <td>Tên danh mục</td>
        <td>Loại danh mục</td>
        <td>Publish</td>
    </tr>
    @foreach (var DMSP in Model.DanhMucSanPhams.ToList())
    {
        <tr>
            <td>
                <input type="checkbox" value="@DMSP.MaDanhMuc" name="checkbox" onchange="Check(value)"/>
            </td>
            <td><a href="@Url.Action("SuaDM", new {id=DMSP.MaDanhMuc })">@DMSP.TenDanhMuc.ToString()</a></td>
            <td>@DMSP.LoaiDanhMuc.TenLoaiDanhMuc.ToString()</td>
            <td>@DMSP.Publish</td>
        </tr>
    }
</table>